import request from '@/utils/request'

// 查询设备附属列表
export function listSubsidiary(query) {
  return request({
    url: '/smart/subsidiary/list',
    method: 'get',
    params: query
  })
}

// 获取设备附属端口信息
export function getSubsidiaryList(id) {
  return request({
    url: '/smart/subsidiary/getSubsidiaryList/' + id,
    method: 'get'
  })
}

// 查询设备附属详细
export function getSubsidiary(id) {
  return request({
    url: '/smart/subsidiary/' + id,
    method: 'get'
  })
}


// 查询设备附属详细
export function getSubsidiaryPort(id) {
  return request({
    url: '/smart/subsidiary/getSubsidiaryPort/' + id,
    method: 'get'
  })
}


// 新增设备附属
export function addSubsidiary(data) {
  return request({
    url: '/smart/subsidiary',
    method: 'post',
    data: data
  })
}

// 新增设备附属端口
export function addSubsidiaryPort(data) {
  return request({
    url: '/smart/subsidiary/addSubsidiaryPort',
    method: 'post',
    data: data
  })
}

// 修改设备附属
export function updateSubsidiary(data) {
  return request({
    url: '/smart/subsidiary',
    method: 'put',
    data: data
  })
}

// 修改设备附属端口
export function updateSubsidiaryPort(data) {
  return request({
    url: '/smart/subsidiary/updateSubsidiaryPort',
    method: 'put',
    data: data
  })
}

// 删除设备附属
export function delSubsidiary(id) {
  return request({
    url: '/smart/subsidiary/' + id,
    method: 'delete'
  })
}

// 删除设备附属端口
export function delSubsidiaryPort(id) {
  return request({
    url: '/smart/subsidiary/delSubsidiaryPort/' + id,
    method: 'delete'
  })
}

// 导出设备附属
export function exportSubsidiary(query) {
  return request({
    url: '/smart/subsidiary/export',
    method: 'get',
    params: query
  })
}

// 查询设备列表
export function getIotDeviceList() {
  return request({
    url: '/smart/subsidiary/getIotDeviceList',
    method: 'get'
  })
}

// 查询运营商列表
export function getOperatorList() {
  return request({
    url: '/smart/subsidiary/getOperatorList',
    method: 'get'
  })
}

export function getStationList(query) {
  return request({
    url: '/operator/electricityPrice/getStationList',
    method: 'get',
    params: query
  })
}

// 查询设备类型列表
export function getDeviceTypeList() {
  return request({
    url: '/smart/subsidiary/getDeviceTypeList',
    method: 'get'
  })
}

// 查询电流类型列表
export function getCurrentTypeList() {
  return request({
    url: '/smart/subsidiary/getCurrentTypeList',
    method: 'get'
  })
}
